package cn.tdu.common.feign;

import cn.tdu.common.result.JsonResult;
import cn.tedu.pojo.param.CartAddParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient("micro-service-cart")//nacos中对应的服务名称
public interface CartClient {
    //调用购物车的新增接口
    @PostMapping("/cart/add")
    JsonResult addCart(@RequestParam("userId") String userId,
                       @RequestParam("productCode") String productCode,
                       @RequestParam("price") BigDecimal price,
                       @RequestParam("count") Integer count);
    //调用购物车的删除接口
    @PostMapping("/cart/delete")
    JsonResult deleteCart(@RequestParam("userId") String userId,
                       @RequestParam("productCode") String productCode);
}
